

PROJECT(kate-kickass-plugin)
# The version number.
set (kate-kickass-plugin_VERSION_MAJOR 0)
set (kate-kickass-plugin_VERSION_MINOR 2)

set(CMAKE_INSTALL_PREFIX /usr)

find_package(KDE4 REQUIRED)
include (KDE4Defaults)
include_directories(${KDE4_INCLUDES})
 
## Compiler flags
if(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "-O2")        ## Optimize
#    set(CMAKE_SHARED_LINKER_FLAGS "-s")  ## Strip binary
    set(CMAKE_MODULE_LINKER_FLAGS "-s")
endif()

# We are calling our plugin "ktexteditor_kickass", and it contains only

set(ktexteditor_kickass_PART_SRCS kickass.cpp kickass_config.cpp)
kde4_add_plugin(ktexteditor_kickass ${ktexteditor_kickass_PART_SRCS})
 
# We need to link our plugin against kdecore libs, as well as ktexteditor
target_link_libraries(ktexteditor_kickass ${KDE4_KDECORE_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KTEXTEDITOR_LIBS} ktexteditor)
 
# Well, we want to install our plugin on the plugin directory
install(TARGETS ktexteditor_kickass DESTINATION ${PLUGIN_INSTALL_DIR})
 
# We also want to install the resource contents file on the data directory, at
# the subdirectory of our plugin name, so it does not mix up with other resource
# contents files.
install(FILES kickassui.rc DESTINATION ${DATA_INSTALL_DIR}/ktexteditor_kickass)
 
# We want to install the desktop file that describes our plugin too. It will go
# on the services directory.
install(FILES ktexteditor_kickass.desktop ktexteditor_kickass_config.desktop DESTINATION ${SERVICES_INSTALL_DIR})

SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Alex Argiropoulos <alkinoos@gmail.com>") #required
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
SET(CPACK_PACKAGE_VERSION "0.2.0")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "2")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY " This is a plugin for the Kate editor to make cross-development for the C64 a bit easier.")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://code.google.com/p/kickass/")

INCLUDE(CPack)
